<template>
  <div class="studnet">
    <h2>学生姓名： {{ name }}</h2>
    <h2>学生性别: {{ sex }}</h2>
    <button @click="sendStudentName">把学生名给school组件</button>
  </div>
</template>

<script>
export default {
  name: "Student",
  data() {
    return {
      name: 'bugdr',
      sex:'男'
    };
  },
  // mounted() {
  //   console.log('Student',this.x);
  // },
  methods: {
    sendStudentName() {
      this.$bus.$emit('')
      console.log('我是school',this.name);
    }
  }
};
</script>

<style lang="less" scoped>
  .studnet {
    background: rgb(125, 224, 231);
  }
</style>